package com.xmhmyh.generalframework.project.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xmhmyh.generalframework.common.BaseServiceImpl;
import com.xmhmyh.generalframework.common.constants.Constants;
import com.xmhmyh.generalframework.common.enums.ResponseCode;
import com.xmhmyh.generalframework.common.enums.YesOrNo;
import com.xmhmyh.generalframework.common.utils.MyBeanUtils;
import com.xmhmyh.generalframework.framework.exceptions.ManageExceptions;
import com.xmhmyh.generalframework.project.sys.dto.UserDTO;
import com.xmhmyh.generalframework.project.sys.entity.User;
import com.xmhmyh.generalframework.project.sys.entity.UserRole;
import com.xmhmyh.generalframework.project.sys.enums.UserStatus;
import com.xmhmyh.generalframework.project.sys.mapper.UserMapper;
import com.xmhmyh.generalframework.project.sys.mapper.UserRoleMapper;
import com.xmhmyh.generalframework.project.sys.service.IUserRoleService;
import com.xmhmyh.generalframework.project.sys.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: 于丁
 * @DateTime: 2020/7/24 9:09 上午
 */
@Service
public class UserRoleServiceImpl extends BaseServiceImpl<UserRoleMapper, UserRole> implements IUserRoleService {


    @Override
    public List<UserRole> getUserRole(Long userId) {

        LambdaQueryWrapper<UserRole> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(UserRole::getUserId, userId);
        List<UserRole> list = list(lambdaQueryWrapper);
        return list;
    }
}
